package com.kongyz.server;


import com.kongyz.registry.ServiceRegistry;
import com.kongyz.rpc.HelloService;

public class RpcBootstrap {

    public static void main(String[] args) {
        String serverAddress="127.0.0.1:18866";
        ServiceRegistry serviceRegistry=new ServiceRegistry("10.25.2.128:2181");
        RpcServer rpcServer=new RpcServer(serverAddress,serviceRegistry);
        HelloService helloService=new HelloServiceImpl();
        rpcServer.addService("com.kongyz.rpc.HelloService",helloService);
        try {
            rpcServer.start();
        }catch (Exception e){
            e.printStackTrace();
        }
    }

}
